/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface WecharPriceSystem extends BasicModel<WecharPriceSystem> {
  code?: string; // 体系编码
  name?: string; // 体系名称
  createByName?: string; // create_by_name
  updateByName?: string; // update_by_name
}

export const wecharPriceSystemList = (params?: WecharPriceSystem | any) =>
  defHttp.get<WecharPriceSystem>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/list', params });

export const wecharPriceSystemListData = (params?: WecharPriceSystem | any) =>
  defHttp.post<Page<WecharPriceSystem>>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/listData', params });

export const wecharPriceSystemForm = (params?: WecharPriceSystem | any) =>
  defHttp.get<WecharPriceSystem>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/form', params });

export const wecharPriceSystemSave = (params?: any, data?: WecharPriceSystem | any) =>
  defHttp.postJson<WecharPriceSystem>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/save', params, data });

export const wecharPriceSystemImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/setting/pricemodel/wecharPriceSystem/importData',
      onUploadProgress,
    },
    params,
  );

export const wecharPriceSystemDisable = (params?: WecharPriceSystem | any) =>
  defHttp.get<WecharPriceSystem>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/disable', params });

export const wecharPriceSystemEnable = (params?: WecharPriceSystem | any) =>
  defHttp.get<WecharPriceSystem>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/enable', params });

export const wecharPriceSystemDelete = (params?: WecharPriceSystem | any) =>
  defHttp.get<WecharPriceSystem>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/delete', params });

export const wecharPriceSystemTreeData = (params?: WecharPriceSystem | any) =>
  defHttp.get<WecharPriceSystem>({ url: adminPath + '/setting/pricemodel/wecharPriceSystem/treeData', params });